<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<!-- base标签为页面上的所有链接规定默认地址或默认目标 -->
<base href="<%=basePath%>">
<meta charset="UTF-8">
<title>index</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/order.css"> 
<link rel="stylesheet" href="">
<script src="js/jquery-3.3.1.js"></script>
<script src="js/jquery.cookie.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/order.js"></script>
<script src="js/header.js"></script>
</head>
<body>
	<div id="box">
		<div id="header">
			<jsp:include page="common/header.jsp" flush="true" />
			<!-- nav导航栏
        <nav class="navbar navbar-inverse  navbar-fixed-top" role="navigation">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#a">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>

            </button>
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">PETCLUB</a>
                </div>
                <div>
                    <ul class="nav navbar-nav collapse navbar-collapse" id="a">
                        <li class="active"><a href="#">首页</a></li>
                        <li><a href="#">市场</a></li>
                        <li><a href="#">论坛</a></li>
                        <li><a href="#">我的家园</a></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user"></i> 个人中心 <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu" style="background-color: ghostwhite">
                                <li class="" style=""><a href="#"><i class="glyphicon glyphicon-log-in"></i>&nbsp;&nbsp;登录</a>
                                </li>
                                <li class="divider"></li>
                                <li class="" style=""><a href="#"><i class="glyphicon glyphicon-registration-mark"></i>&nbsp;&nbsp;登录</a>
                                </li>
                            </ul>
                        </li>
                    </ul>


                </div>
            </div>
        </nav> -->
		</div>
		<div class="container">
			<div class="row">
				<div class="panel panel-default">
					<div class="panel-heading">
						<p style="font-size: 150%; padding-top: 0.5%">
							<i class="glyphicon glyphicon-info-sign" style="font-size: 120%"></i>申请订单
						</p>
					</div>
					<div class="panel-body">
						<div class="col-md-10 " style="">
							<div style="padding: 1%">
								<i class="glyphicon glyphicon-info-sign"
									style="font-size: 100%; color: lightskyblue">确认个人信息</i>
							</div>
							<div
								style="border-bottom: 2px solid gainsboro; border-top: 2px solid gainsboro">
								<ul style="list-style:none;padding: 1%">
									<li><i class="glyphicon glyphicon-user"></i>姓名：${user.username}</li>
									<li><i class="glyphicon glyphicon-phone"></i>手机：${user.phone}</li>
									<li><i class="glyphicon glyphicon-envelope"></i>邮箱：${user.email}</li>
									<!--  <li><i class="glyphicon glyphicon-globe"></i>地址：</li> -->

								</ul>
							</div>
							<div style="padding: 1%">
								<i class="glyphicon glyphicon-info-sign"
									style="font-size: 100%; color: lightskyblue">确认申请信息</i>
							</div>
							<div class="col-md-12 col-xm-12"
								style="border-bottom: 2px solid gainsboro; border-top: 2px solid gainsboro;padding-top: 5%;margin-bottom:25%">
								<dl class="dl-horizontal">
									<dt style="padding-left: 0%; padding-top: 0%">
										<a class="thumbnail" href="http://localhost:8080/distribute-portal/item/${itemInfo.id}.html"><img style=""
											src="${itemInfo.image}" alt=""></a>
									</dt>
									<dd style="padding-top: 0">
										<ul style="list-style: none;">
											<li>名字：${itemInfo.name}</li>
											<li>年龄：${itemInfo.age}</li>
											<li>性别：${itemInfo.sex}</li>
											<li>健康状态：${itemInfo.health}</li>
											<!-- <li>当前申领人数:</li>
											<li>当前申领最高价:</li>
											<li><div class="input-group input-group-sm"
													style="padding-left: 30%; padding-top: 0%">
													<span class="input-group-addon" style="">请输入申领金额（可选）</span><input
														class="form-control " type="text" name="" id="money"
														style="width: 100%"><span
														class="input-group-addon">元</span>
												</div></li> -->
										</ul>
									</dd>
								</dl>
							</div>

							<!--<div class="col-md-6 "
                             style="border-bottom: 2px solid lightskyblue;border-top: 2px solid lightskyblue;">
                            <div class="input-group" style="padding-top: 55%">
                                <span class="input-group-addon" style="width: 2%">申领金额</span><input
                                    class="form-control" type="text" name="" id="money" style="width: 100%"><span
                                    class="input-group-addon">元</span>
                            </div>
                        </div>-->
						</div>

					</div>
					<form id="orderForm" class="hide" 
						method="post">
						<!-- <input type="hidden" name="paymentType" value="1" />  -->
						<input type="hidden" name="orderItem.itemId" value="${itemInfo.id}" />
						<input type="hidden" name="orderItem.name" value="${itemInfo.name}" />
						<input type="hidden" name="orderItem.age" value="${itemInfo.age}" />
						<input type="hidden" name="orderItem.sex" value="${itemInfo.sex}" /> 
						<input type="hidden"name="orderItem.title" value="${itemInfo.title}" /> 
						<input type="hidden" name="orderItem.picPath" value="${itemInfo.image}" />
						<input type="hidden" name="redis_token" value="${redis_token}" />
					</form>
					<div class="panel-footer">
						<i class="glyphicon glyphicon-arrow-right"
							style="font-size: 100%; color: dodgerblue"></i>
						<button class="btn btn-info cancel-apply" style="margin-left: 50%">取消申请</button>
						<button class="btn btn-info confirm-apply" style="margin-left: 2%">提交申请</button>
					</div>
				</div>

			</div>
		</div>

	</div>
</body>
<script>
	$(function() {
		$(".cancel-apply").click(function() {
			window.location.href="http://localhost:8080/distribute-portal/item/${itemInfo.id}.html";
		});
		$(".confirm-apply").click(function() {
			var token=$.cookie("TT_TOKEN");
			var action='http://localhost:8080/distribute-portal/order/create.html?token='+token;
			$("#orderForm").attr("action",action);
			$("#orderForm").submit();
		});
		alert("inf:" + userInfo);
	});
</script>
</html>
